<%--
  Created by IntelliJ IDEA.
  User: zzz
  Date: 2019/10/9
  Time: 15:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>login</title>
    <link rel="stylesheet" href="css/reset.css" />
    <link rel="stylesheet" href="css/login.css" />
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/login.js"></script>
    <script src="js/jquery-2.1.1.min.js" type="text/javascript"></script>
</head>
<body>

<c:if test="${not empty cookie.aname}">
    <c:redirect url="CookieLoginServlet.action">
        <c:param name="cookiename" value="${cookie.aname.value}"></c:param>
        <c:param name="cookiepass" value="${cookie.apass.value}"></c:param>
    </c:redirect>
</c:if>
<script>
    $(function () {
            $('#servlet-msg').html("${requestScope.message}");
            if(${not empty param.msg}){
                $('#servlet-msg').html("密码保存过期，请重新登录！");
            }
    });
</script>
<div class="page">
    <div class="loginwarrp">
        <div class="logo">管理员登陆</div>
        <div class="login_form">
            <form id="Login"  method="post" action="${pageContext.request.contextPath}/LoginServlet.action">
                <li>
                    <span id="servlet-msg"></span>
                </li>
                <li class="login-item">
                    <span>用户名：</span>
                    <input type="text" id="username" name="aname" class="login_input" >
                    <span id="count-msg" class="error"></span>
                </li>
                <li class="login-item">
                    <span>密　码：</span>
                    <input type="password" id="password" name="apass" class="login_input" >
                    <span id="password-msg" class="error"></span>
                </li>
                <li class="login-item verify">
                    <span>验证码：</span>
                    <input type="text" id="CheckCode" name="CheckCode" class="login_input verify_input">
                    <span id="CheckCode-msg" class="error"></span>
                </li>
                <img id="img" src="${pageContext.request.contextPath}/CheckCodeServlet.action" border="0" class="verifyimg" />
                <li class="remember">
                    <input type="checkbox" name="remember" value="1" style="float: left;"><span style="float: left; margin-top: 3px">记住我</span>
                </li>
                <li class="login-sub">
                    <input type="submit" name="Submit" value="登录" />
                    <input type="reset" name="Reset" value="重置" />
                </li>

            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    window.onload = function() {
        var config = {
            vx : 4,
            vy : 4,
            height : 2,
            width : 2,
            count : 100,
            color : "121, 162, 185",
            stroke : "100, 200, 180",
            dist : 6000,
            e_dist : 20000,
            max_conn : 10
        }
        CanvasParticle(config);

        document.getElementById("img").onclick = function () {
            this.src = "${pageContext.request.contextPath}/CheckCodeServlet.action?time="+new Date().getTime();
        }
    }
</script>
<script type="text/javascript" src="js/canvas-particle.js"></script>
</body>
</html>
